﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;

// -----------------------------------------------------------------------
// <copyright file="$safeitemrootname$.cs" company="$registeredorganization$">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------
namespace ObjectLibrary
{
    public abstract class MyModel
    {

        protected Model _model;
        protected Matrix _transformMatrix  ;
        protected float _scale;
        protected Vector3 _position;
        protected float _rotationY= 0;
        protected Matrix _rotation = Matrix.Identity;


        public float Scale
        {
            get { return _scale; }
            set
            {
                _scale = value;
                _transformMatrix = Matrix.CreateRotationY(_rotationY) * Matrix.CreateScale(_scale) * Matrix.CreateTranslation(_position);
            }
        }


        public Vector3 Position
        {
            get { return _position; }
            set
            {
                _position = value;
                _transformMatrix = Matrix.CreateRotationY(_rotationY) * Matrix.CreateScale(_scale) * Matrix.CreateTranslation(_position);
            }
        }


        public float RotationY
        {
            get { return _rotationY; }
            set
            {
                _rotationY = value;
                _transformMatrix = Matrix.CreateRotationY(_rotationY) * Matrix.CreateScale(_scale) * Matrix.CreateTranslation(_position);
            }
        }

        public Matrix TransformMatrix
        {
            get { return _transformMatrix; }
            set { _transformMatrix = value; }
        }

        

        public Model Model
        {
            get { return _model; }
            set { _model = value; }
        }

        public virtual void Draw(GameTime gameTime, GraphicsDevice graphicsDevice, Effect effect, MyCamera camera)
        {
        }

        public virtual void Update(GameTime gameTime)
        { 
        }
    }
}
